<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-on</title>
</head>

<body>
    <div id="app">
        <input type="button" value="vue的点击事件绑定" v-on:click="doIt">

        <br>
        <!-- 简写方式 -->
        <input type="button" value="简写vue的点击事件绑定" @click="doIt">


        <br>
        <!-- 简写方式 -->
        <input type="button" value="简写vue的双击事件绑定" @dblclick="doIt">

        <div v-text="message" @click="changMessage"></div>

    </div>
    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue!'
            },
            methods: {
                doIt: function() {
                    alert("显示vue事件");
                },
                changMessage() {
                    this.message += "添加数据！";
                    console.log(this.message);

                }
            }
        })
    </script>
</body>

</html>